All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.naming.CompoundName

java.lang.Object
   |
   +----java.naming.CompoundName

public class CompoundName
extends Object
implements Cloneable, Name
The CompoundName class represents a compound name -- a name from a hierarchical name space. Each component in a compound name is an atomic name. The components of a compound name are numbered. The indexes of a compound name with N components range from 0 up to, but not including, N. This range may be written as [0,N). An empty compound name has no components. The syntax of a compound name is specified using a set of properties: jndi.syntax.direction Direction for parsing ("right_to_left", "left_to_right", "flat") jndi.syntax.separator Separator between atomic name components. Required unless direction is "flat." jndi.syntax.ignorecase If present, true means is case insensitive; case sensitive otherwise. jndi.syntax.escape If present, escape string for overriding separator, escapes and quotes jndi.syntax.beginquote If present, string delimiting start of quoted string jndi.syntax.endquote String delimiting end of quoted string. If not present, use syntax_begin_quote1 as end quote. jndi.syntax.beginquote2 Alternative set of begin/end quotes. jndi.syntax.endquote2 Alternative set of begin/end quotes. jndi.syntax.separator.ava If present, string that separates attribute-value-assertions when specifying multiple attribute/value pairs. (e.g. "," in age=65,gender=male). jndi.syntax.separator.typeval If present, string that separators attribute from value (e.g. "=" in "age=65")


Variable Index

 o impl
 o mySyntax

Constructor Index

 o CompoundName(String, Properties)
Constructs a new compound name instance by parsing the string n using the syntax specified by the syntax properties supplied.
 o CompoundName(StringEnumeration, Properties)

Method Index

 o appendComponent(String)
Adds a single component to the end of this compound name.
 o appendName(Name)
Adds the components of a compound name -- in order -- to the end of this compound name.
 o clone()
Creates a copy of this compound name.
 o deleteComponent(int)
Deletes a component from this compound name.
 o equals(Object)
Determines whether obj is syntactically equal to this compound name.
 o getComponent(int)
Retrieves a component of this compound name.
 o getComponentCount()
Retrieves the number of components in this compound name.
 o getComponents()
Retrieves the components of this compound name as an enumeration of strings.
 o getPrefix(int)
Retrieves a compound name whose components consist of a prefix of the components in this compound name.
 o getSuffix(int)
Retrieves a compound name whose components consist of a suffix of the components in this compound name.
 o hashCode()
Computes the hash code of this compound name.
 o insertComponent(int, String)
Adds a single component at a specified position within this compound name.
 o insertName(int, Name)
Adds the components of a compound name -- in order -- at a specified position within this compound name.
 o isEmpty()
Determines whether this compound name is empty.
 o isPrefix(Name)
Determines whether a compound name is a prefix of this compound name.
 o isSuffix(Name)
Determines whether a compound name is a suffix of this compound name.
 o prependComponent(String)
Adds a single component to the start of this compound name.
 o prependName(Name)
Adds the components of a compound name -- in order -- to the beginning of this compound name.
 o toString()
Generates the string representation of this compound name, using the syntax rules of the compound name.

Variables

 o impl
 protected NameImpl impl
 o mySyntax
 protected Properties mySyntax

Constructors

 o CompoundName
 protected CompoundName(StringEnumeration comps,
                        Properties syntax)
 o CompoundName
 public CompoundName(String n,
                     Properties syntax) throws InvalidNameException
Constructs a new compound name instance by parsing the string n using the syntax specified by the syntax properties supplied.

Parameters:
n - The string to parse.
syntax - A list of properties that specify the syntax of this compound name.

Methods

 o toString
 public String toString()
Generates the string representation of this compound name, using the syntax rules of the compound name.

Returns:
A string representation of this compound name.
Overrides:
toString in class Object
 o equals
 public boolean equals(Object obj)
Determines whether obj is syntactically equal to this compound name.

Parameters:
obj - The object to compare against.
Returns:
true if obj is equal to this compound name, false otherwise.
Overrides:
equals in class Object
 o hashCode
 public int hashCode()
Computes the hash code of this compound name.

Returns:
The hash code computed using characters from this compound name.
Overrides:
hashCode in class Object
 o clone
 public Object clone()
Creates a copy of this compound name.

Returns:
A copy of this compound name.
Overrides:
clone in class Object
 o getComponentCount
 public int getComponentCount()
Retrieves the number of components in this compound name.

Returns:
The number of components in this compound name.
 o isEmpty
 public boolean isEmpty()
Determines whether this compound name is empty.

Returns:
true if this compound name is empty, false otherwise.
 o getComponents
 public StringEnumeration getComponents()
Retrieves the components of this compound name as an enumeration of strings.

Returns:
An enumeration of the components of this compound name.
 o getComponent
 public String getComponent(int posn)
Retrieves a component of this compound name.

Parameters:
posn - The 0-based index of the component to retrieve. Must be in the range [0,getComponentCount()).
Returns:
The component at index posn.
 o getPrefix
 public Name getPrefix(int posn)
Retrieves a compound name whose components consist of a prefix of the components in this compound name.

Parameters:
posn - The 0-based index of the component at which to stop. Must be in the range [0,getComponentCount()].
Returns:
A compound name consisting of the components at indexes in the range [0,posn).
 o getSuffix
 public Name getSuffix(int posn)
Retrieves a compound name whose components consist of a suffix of the components in this compound name.

Parameters:
posn - The 0-based index of the component at which to start. Must be in the range [0,getComponentCount()].
Returns:
A compound name consisting of the components at indexes in the range [posn,getComponentCount()). If posn is equal to getComponentCount(), an empty compound name is returned.
 o isPrefix
 public boolean isPrefix(Name n)
Determines whether a compound name is a prefix of this compound name. A compound name 'n' is a prefix if it is equal to getPrefix(n.getComponentCount()).

Parameters:
n - The compound name to check.
Returns:
true if n is a prefix of this compound name, false otherwise.
 o isSuffix
 public boolean isSuffix(Name n)
Determines whether a compound name is a suffix of this compound name. A compound name 'n' is a suffix if it it is equal to getSuffix(getComponentCount()-n.getComponentCount()).

Parameters:
n - The compound name to check.
Returns:
true if n is a suffix of this compound name, false otherwise.
 o prependName
 public void prependName(Name prefix) throws InvalidNameException
Adds the components of a compound name -- in order -- to the beginning of this compound name.

Parameters:
prefix - The components to add.
 o appendName
 public void appendName(Name suffix) throws InvalidNameException
Adds the components of a compound name -- in order -- to the end of this compound name.

Parameters:
suffix - The components to add.
 o insertName
 public void insertName(int posn,
                        Name n) throws InvalidNameException
Adds the components of a compound name -- in order -- at a specified position within this compound name. Components of this compound name at or after the index of the first new component are shifted to accommodate the new components.

Parameters:
n - The components to add.
posn - The index in this name at which to add the new components. Must be in the range [0,getComponentCount()].
 o prependComponent
 public void prependComponent(String comp) throws InvalidNameException
Adds a single component to the start of this compound name.

Parameters:
comp - The component to add.
 o appendComponent
 public void appendComponent(String comp) throws InvalidNameException
Adds a single component to the end of this compound name.

Parameters:
comp - The component to add.
 o insertComponent
 public void insertComponent(int posn,
                             String comp) throws InvalidNameException
Adds a single component at a specified position within this compound name. Components of this compound name at or after the index of the new component are shifted by one to accommodate the new component.

Parameters:
comp - The component to add.
posn - The index at which to add the new component. Must be in the range [0,getComponentCount()].
 o deleteComponent
 public void deleteComponent(int posn) throws InvalidNameException
Deletes a component from this compound name.

Parameters:
posn - The index of the component to delete. Must be in the range [0,getComponentCount()].

All Packages  Class Hierarchy  This Package  Previous  Next  Index